/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package view.tabbedpane;

import java.awt.Color;
import java.util.Observable;
import java.util.Observer;

import javax.swing.GroupLayout;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

import view.product.ProductMainPanel;
import view.product.ProductSupplierPanel;

public class ProductTabbedPane extends JPanel {

	private static final long serialVersionUID = 1L;

	public ProductTabbedPane() {
		initComponents();
		
		pn_supplier.getController().addObserver(pn_product_main.getController());
	}
	public Observable getObserverable(){
		return pn_product_main.getController();
	}
	
	public Observer getObserver(){
		return pn_product_main.getController();
	}

	private void initComponents() {

		tabPane = new JTabbedPane();
		pn_product_main = new ProductMainPanel();
		pn_supplier = new ProductSupplierPanel();
		
		pn_product_main.setBackground(Color.WHITE);
		pn_supplier.setBackground(Color.WHITE);
		pn_product_main.setBounds(0, 0, 906, 480);
		pn_supplier.setBounds(0, 0, 906, 480);
		
		setForeground(new java.awt.Color(255, 255, 255));

		tabPane.addTab("Product", pn_product_main);
		tabPane.addTab("Supplier", pn_supplier);

		GroupLayout layout = new GroupLayout(this);
		this.setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(
				GroupLayout.Alignment.LEADING).addComponent(tabPane));
		layout.setVerticalGroup(layout.createParallelGroup(
				GroupLayout.Alignment.LEADING).addComponent(tabPane));
	}

	private ProductMainPanel pn_product_main;
	private ProductSupplierPanel pn_supplier;
	private JTabbedPane tabPane;

}
